package com.xshbbs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xshbbs.dao.PartitionMapper;
import com.xshbbs.entity.Partition;
import com.xshbbs.service.PartitionService;

@Service
public class PartitionServiceImpl implements PartitionService {
	
	@Autowired
	private PartitionMapper partitionMapper; 
	
	public String admit(Partition partition) {
		
		if(partition.getName() == "" || partition.getName().equals("")) {
			return "分区名不能为空";
		}
		return "1";
		
	}
	
	@Override
	public List<Partition> selectAllPartition() {
		return this.partitionMapper.selectAllPartition();
	}

	@Override
	public Partition selectPartitionById(Integer id) {
		return this.partitionMapper.selectPartitionById(id);
	}

	@Override
	public boolean insertPartition(Partition partition) {
		return this.partitionMapper.insertPartition(partition);
	}

	@Override
	public boolean deletePartitionById(Integer id) {
		return this.partitionMapper.deletePartitionById(id);
	}

	@Override
	public boolean updatePartitionById(Partition partition) {
		return this.partitionMapper.updatePartitionById(partition);
	}



	
	
}
